<?php
namespace SysAdmin\Controller;
use Think\Controller;
header("content-type:text/html;charset=utf-8");
class SystemController extends LoginTrueController{
    public function System(){
        $this->LoginTrue();
        $systemInfo=M("system");
        $rs_systemInfo=$systemInfo->where("sId=1")->find();
        $this->assign("rs_systemInfo",$rs_systemInfo);
        $this->display();
    }
    public function SystemParam(){
        $this->LoginTrue();

        $systemInfo=M("system");
        $rs_systemInfo=$systemInfo->where("sId=1")->find();

print_r($rs_systemInfo);

        $from = date("H:i",$rs_systemInfo["guanbegin"]);
        $end = date("H:i",$rs_systemInfo["guanend"]);

        $this->assign("from",$from);
        $this->assign("end",$end);
        $this->assign("rs_systemInfo",$rs_systemInfo);
        $this->display();
    }
	public function SystemParamAction(){
        $this->LoginTrue();
        $data["vip1"]=$_POST["vip1"];
        $data["vip2"]=$_POST["vip2"];
        $data["vip3"]=$_POST["vip3"];

        $data["tongka"]=$_POST["tongka"];
        $data["yinka"]=$_POST["yinka"];
        $data["jinka"]=$_POST["jinka"];

        $data["jiandian_tong"]=$_POST["jiandian_tong"];
        $data["jiandian_yin"]=$_POST["jiandian_yin"];
        $data["jiandian_jin"]=$_POST["jiandian_jin"];

        $data["tong_bili"]=$_POST["tong_bili"];
        $data["yin_bili"]=$_POST["yin_bili"];
        $data["jin_bili"]=$_POST["jin_bili"];




        $data["dianmoney"]=$_POST["dianmoney"];
        // $data["dianceng"]=$_POST["dianceng"];
       // $data["affectmoney"]=$_POST["affectmoney"];
        $data["affectceng"]=$_POST["affectceng"];
        // $data["cxbili"]=$_POST["cxbili"];
        $data["ksbili"]=$_POST["ksbili"];
        $data["sysreg"]=$_POST["sysreg"];
        $data["syslogin"]=$_POST["syslogin"];
        $data["sysset"]=$_POST["sysset"];
        $data["bilikc"]=$_POST["bilikc"];

        $data["guanbegin"]=$_POST["from"];
        $data["guanend"]=$_POST["until"];
        $data["sCheckCodeSwitch"]=$_POST["sCheckCodeSwitch"];
        $data["sErrorPwdLockNum"]=$_POST["sErrorPwdLockNum"];
        $data["sLoginTimeout"]=$_POST["sLoginTimeout"];
		
		
        $systemInfo=M("system");
        $result=$systemInfo->where("sId=1")->save($data);
        if($result){
            $this->success("更新成功");
        }else{
            $this->error("更新失败");
        }
		
	}
	

}